import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path:'/home',
    name:'home',
    component: ()=>import('@/views/Home.vue'),
    redirect:'/home/recommend',
    children:[
      {
        path:'idea',
        name:'idea',
        component: ()=>import('@/views/Home/Idea.vue')
      },
      {
        path:'recommend',
        name:'recommend',
        component: ()=>import('@/views/Home/Recommend.vue')
      },
      {
        path:'hot',
        name:'hot',
        component: ()=>import('@/views/Home/Hot.vue')
      },
    ]
  },

  {
    path:'/mine',
    name:'mine',
    component: ()=>import('@/views/Mine.vue')
  },
  {
    path:'/login',
    name:'login',
    component: ()=>import('@/views/Login.vue')
  },
  {
    path:'/register',
    name:'register',
    component: ()=>import('@/views/Register.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
